package com.zr.model;
// Generated 2017-7-6 10:10:11 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Cstationtype generated by hbm2java
 */
@Entity
@Table(name = "cstationtype", catalog = "cqlwlps")
public class Cstationtype implements java.io.Serializable {

	private Integer distypeid;
	private Cdisstation cdisstation;
	private String distype;
	private String disstate;
	private Set<Cdisstation> cdisstations = new HashSet<Cdisstation>(0);

	public Cstationtype() {
	}

	public Cstationtype(Cdisstation cdisstation) {
		this.cdisstation = cdisstation;
	}

	public Cstationtype(Cdisstation cdisstation, String distype, String disstate, Set<Cdisstation> cdisstations) {
		this.cdisstation = cdisstation;
		this.distype = distype;
		this.disstate = disstate;
		this.cdisstations = cdisstations;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "cdisstation"))
	@Id
	@GeneratedValue(generator = "generator")

	@Column(name = "distypeid", unique = true, nullable = false)
	public Integer getDistypeid() {
		return this.distypeid;
	}

	public void setDistypeid(Integer distypeid) {
		this.distypeid = distypeid;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Cdisstation getCdisstation() {
		return this.cdisstation;
	}

	public void setCdisstation(Cdisstation cdisstation) {
		this.cdisstation = cdisstation;
	}

	@Column(name = "distype")
	public String getDistype() {
		return this.distype;
	}

	public void setDistype(String distype) {
		this.distype = distype;
	}

	@Column(name = "disstate")
	public String getDisstate() {
		return this.disstate;
	}

	public void setDisstate(String disstate) {
		this.disstate = disstate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cstationtype")
	public Set<Cdisstation> getCdisstations() {
		return this.cdisstations;
	}

	public void setCdisstations(Set<Cdisstation> cdisstations) {
		this.cdisstations = cdisstations;
	}

}
